I have an issue where I set the window's path to '/payment/success?username=the+users+name' by using the following code:
window.location.pathname = `/payment/success?userName=the+users+name}`;
The issue is, that the page reloads, the actual path turns out to be:
/payment/success/account-created%3FuserName=the+users+name
For some reason, either JS or the browser is converting my "?" into "%3F", and I can't parse the paramater set in the url.
How can I stop it from encoding the special character?